package com.test.SocketDemo;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * ${DESCRIPTION}
 *
 * @author muxiaoyu
 * @create 2017/06/07 16:07
 **/
public class SocketServer {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(4242);
        Socket accept = serverSocket.accept();
        InputStream inputStream = accept.getInputStream();
        int len;
        while ((len = inputStream.read()) != -1) {
            System.out.println(len);
        }
    }
}
